home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / usr / lib / python2.5 / lib-tk / tkCommonDialog.pyc (.txt) < prev    next >
Python Compiled Bytecode  |  2008-10-29  |  2KB  |  49 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.5)
  3.  
  4. from Tkinter import *
  5.  
  6. class Dialog:
  7.     command = None
  8.     
  9.     def __init__(self, master = None, **options):
  10.         if TkVersion < 4.2:
  11.             raise TclError, 'this module requires Tk 4.2 or newer'
  12.         
  13.         self.master = master
  14.         self.options = options
  15.         if not master and options.get('parent'):
  16.             self.master = options['parent']
  17.         
  18.  
  19.     
  20.     def _fixoptions(self):
  21.         pass
  22.  
  23.     
  24.     def _fixresult(self, widget, result):
  25.         return result
  26.  
  27.     
  28.     def show(self, **options):
  29.         for k, v in options.items():
  30.             self.options[k] = v
  31.         
  32.         self._fixoptions()
  33.         w = Frame(self.master)
  34.         
  35.         try:
  36.             s = w.tk.call(self.command, *w._options(self.options))
  37.             s = self._fixresult(w, s)
  38.         finally:
  39.             
  40.             try:
  41.                 w.destroy()
  42.             except:
  43.                 pass
  44.  
  45.  
  46.         return s
  47.  
  48.  
  49.